define (require, exports, module) ->
  # 引入样式
  require 'mods/dialog/dialog_css.css'
  # 定义头部组件
  cDialog = Vue.extend
    props: ['dialogOption']
    template: require 'mods/dialog/dialog_tpl.pug'
    mounted:()->
      self = @
      self.$watch 'dialogOption',(dialogOption)->
        if dialogOption?.state
          if !!dialogOption?.width
            $('.c-dialog').width(dialogOption?.width)
          else
            $('.c-dialog').width(300)
  # 注册全局组件
  Vue.component 'c-dialog', cDialog